Public Class registrarCurso
    Private objG As capaNegocios.Gestor = objG.instanciar()

    Private Sub Agregar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Registrar.Click
        Dim cod, nom As String
        cod = Me.codigo.Text
        nom = Me.nombre.Text
        Dim ingresado As Boolean = False
        Try
            objG.registrarCurso(cod, nom)
            Me.DialogResult = Windows.Forms.DialogResult.OK
            MessageBox.Show("Fue registrado satisfactoriamente", "", MessageBoxButtons.OK, MessageBoxIcon.Information)
        Catch ex As Exception
            MessageBox.Show(ex.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error)
            Me.DialogResult = Windows.Forms.DialogResult.None
        End Try
    End Sub

    Private Sub Cancelar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancelar.Click
        Close()
    End Sub

    'Private Sub a(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
    '    If e.KeyCode = Keys.Escape Then
    '        Me.Close()
    '    End If
    'End Sub
End Class